package com.k2.gulimall.member.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.k2.common.utils.PageUtils;
import com.k2.common.utils.Query;

import com.k2.gulimall.member.dao.MemberReceiveAddressDao;
import com.k2.gulimall.member.entity.MemberReceiveAddressEntity;
import com.k2.gulimall.member.service.MemberReceiveAddressService;


@Service("memberReceiveAddressService")
public class MemberReceiveAddressServiceImpl extends ServiceImpl<MemberReceiveAddressDao, MemberReceiveAddressEntity> implements MemberReceiveAddressService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<MemberReceiveAddressEntity> queryWrapper = new QueryWrapper<MemberReceiveAddressEntity>();
        if (params.get("memberId")!=null&&params.get("memberId").toString().length()>0) {
            queryWrapper.eq("member_id", params.get("memberId"));
        }
        IPage<MemberReceiveAddressEntity> page = this.page(
                new Query<MemberReceiveAddressEntity>().getPage(params),
                queryWrapper
        );
        return new PageUtils(page);
    }

}